package org.example.union;

import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.common.typeinfo.TypeHint;
import org.apache.flink.api.common.typeinfo.Types;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.ProcessFunction;
import org.apache.flink.util.Collector;
import org.apache.flink.util.OutputTag;
import org.example.flink.pojo.WaterSensor;

import java.util.Arrays;

/**
 * @Author: tang
 * @Description:
 * @Date 2025/2/18 10:03
 */
public class FlinkUnion {

    public static void main(String[] args) throws Exception {

        StreamExecutionEnvironment environment = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(new Configuration());

        environment.setParallelism(4);

        DataStreamSource<String> s1 = environment
                .fromCollection(Arrays.asList("11","22","33","44"));

        DataStreamSource<String> s2 = environment
                .fromCollection(Arrays.asList("21","22","23","24"));

        s1.union(s2).print();

        environment.execute();

    }

}
